package org.publictransport.server.service.data;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.publictransport.client.gwt.client.data.TransportLineSerializable;



import com.google.gwt.user.client.rpc.IsSerializable;
@PersistenceCapable
public class TransportLine implements IsSerializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private TransportType type;
	@Persistent
	private double startPointLatitude;
	public double getStartPointLatitude() {
		return startPointLatitude;
	}
	public void setStartPointLatitude(double startPointLatitude) {
		this.startPointLatitude = startPointLatitude;
	}
	public double getStartPointLongitude() {
		return startPointLongitude;
	}
	public void setStartPointLongitude(double startPointLongitude) {
		this.startPointLongitude = startPointLongitude;
	}
	public double getEndPointLatitude() {
		return endPointLatitude;
	}
	public void setEndPointLatitude(double endPointLatitude) {
		this.endPointLatitude = endPointLatitude;
	}
	public double getEndPointLongitude() {
		return endPointLongitude;
	}
	public void setEndPointLongitude(double endPointLongitude) {
		this.endPointLongitude = endPointLongitude;
	}
	@Persistent
	private double startPointLongitude;
	@Persistent
	private double endPointLatitude;
	@Persistent
	private double endPointLongitude;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public TransportType getType() {
		return type;
	}
	public void setType(TransportType type) {
		this.type = type;
	}
	public TransportLineSerializable getNewTransportLineSerializable() {
		TransportLineSerializable transportLineSerializable = new TransportLineSerializable();
		transportLineSerializable.setEndPointLatitude(endPointLatitude);
		transportLineSerializable.setEndPointLongitude(endPointLongitude);
		transportLineSerializable.setId(id);
		transportLineSerializable.setStartPointLatitude(startPointLatitude);
		transportLineSerializable.setStartPointLongitude(startPointLongitude);
		return transportLineSerializable;
	}

}
